
package com.wdf.dota;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class AboutProductActivity   extends Activity{

	Button returnCommentBtn;

	TextView productName ;
	TextView productVersion ;
	TextView productOwner ;
	
	TextView contact1 ;
	TextView contact2 ;
	
	TextView teamMembers ;

	
	public void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		setContentView(R.layout.about_product);
		


		productName = (TextView)this.findViewById(R.id.product_name);
		productVersion = (TextView)this.findViewById(R.id.product_version);
		productOwner = (TextView)this.findViewById(R.id.product_owner);
		
		contact1 = (TextView)this.findViewById(R.id.contact1);
		contact2 = (TextView)this.findViewById(R.id.contact2);
		teamMembers= (TextView)this.findViewById(R.id.team_members);
		
		returnCommentBtn =  (Button) findViewById(R.id.return_comment);
		returnCommentBtn.setOnClickListener(returnCommentButtonListener);
		
		productName.setText(R.string.app_name);
		
		 PackageManager packageManager = getPackageManager();     
		   //getPackageName()是你当前类的包名，0代表是获取版本信息      
		    try {
			PackageInfo packInfo = packageManager.getPackageInfo(getPackageName(), 0);
			productVersion.setText(packInfo.versionName);
			} catch (NameNotFoundException e) {
				
			}     
        
		    productOwner.setText("汪大锋");

		
			contact1.setText("联系QQ: 409921854");
			contact2.setText("QQ讨论群: 242491517");
		
			teamMembers.setText("团队成员:\n" +
					"论坛管理员: 一只老菜鸟 \n" +
					"版主: 乌拉泊" +
					"\n" +
					"我们随时都欢迎新成员的加入!");
		
	}
	
	OnClickListener returnCommentButtonListener = new OnClickListener() {
		@Override
		public void onClick(View v) {
			AboutProductActivity.this.finish();
		}
	};
	
	
	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
	            super.onActivityResult(requestCode, resultCode, data);
	                
	}

}
